
package com.doc2video.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 文档实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_document")
@ApiModel(value = "Document对象", description = "文档表")
public class Document implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "文档ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "用户ID")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "文档名称")
    @TableField("doc_name")
    private String docName;

    @ApiModelProperty(value = "文档原始名称")
    @TableField("original_name")
    private String originalName;

    @ApiModelProperty(value = "文档类型：pdf、doc、docx、ppt、pptx、txt")
    @TableField("doc_type")
    private String docType;

    @ApiModelProperty(value = "文档大小（字节）")
    @TableField("file_size")
    private Long fileSize;

    @ApiModelProperty(value = "文档路径")
    @TableField("file_path")
    private String filePath;

    @ApiModelProperty(value = "文档内容文本")
    @TableField("content_text")
    private String contentText;

    @ApiModelProperty(value = "处理状态：0-待处理，1-处理中，2-已完成，3-失败")
    @TableField("process_status")
    private Integer processStatus;

    @ApiModelProperty(value = "处理进度（0-100）")
    @TableField("process_progress")
    private Integer processProgress;

    @ApiModelProperty(value = "处理失败原因")
    @TableField("error_msg")
    private String errorMsg;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除：0-未删除，1-已删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;
}
